package com.bnyy.gbp;

import android.content.Context;
import android.location.LocationManager;

/**
 * Author : 关炳鹏
 * Description :
 * Date : 2021/10/21
 **/
public class LocationUtils {

    /**
     * 判断定位服务是否开启
     * @return 是否开启
     */
    public static boolean isLocationServiceEnable(Context context) {
        LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);

        return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER) || locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
    }
}
